<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改用户')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-user-edit" th:object="${user}">
        <input name="keyId" th:field="*{keyId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户id
                ：</label>
            <div class="col-sm-8">
                <input name="keyId" th:field="*{keyId}" class="form-control"
                       type="text" required readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">昵称
                ：</label>
            <div class="col-sm-8">
                <input name="nickName" th:field="*{nickName}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">密码(不需要修改就不用填)
                ：</label>
            <div class="col-sm-8">
                <input name="password"  class="form-control"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">手机号
                ：</label>
            <div class="col-sm-8">
                <input name="phone" th:field="*{phone}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">性别
                ：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_user_sex')}">
                    <input type="radio" th:id="${'gender_' + dict.dictCode}" name="gender"
                           th:value="${dict.dictValue}" th:field="*{gender}" required>
                    <label th:for="${'gender_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户状态
                ：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_user_status')}">
                    <input type="radio" th:id="${'userStatus_' + dict.dictCode}" name="userStatus"
                           th:value="${dict.dictValue}" th:field="*{userStatus}" required>
                    <label th:for="${'userStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">微信支付所需要
                ：</label>
            <div class="col-sm-8">
                <input name="openId" th:field="*{openId}" class="form-control"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">小程序唯一标识
                ：</label>
            <div class="col-sm-8">
                <input name="unionId" th:field="*{unionId}" class="form-control"
                       type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "user/user";
    $("#form-user-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
        }
    }
</script>
</body>
</html>